import urllib
import re
import string
import time
import MySQLdb

m = MySQLdb.connect('localhost', 'root', '', 'news')
n = m.cursor()


a=open('new2.txt')
aleph = {}
v = string.split(a.read(), ' ')

for x in range(10):
	
	xx = urllib.urlopen(v[x])
	zz = string.upper(xx.read())
	zz.strip()
	d=re.sub('<.*?>', '', re.subn(r'<(script).*?</\1>(?s)', '', zz)[0])
	d =re.sub('\n\r\t', '', d)
	dd = string.split(d, ' ')
	for y in dd:
		sx = y.replace('\t', '')
		sx = sx.replace('\n', '')
		sx = sx.replace('\r', '')
		if aleph.has_key(sx):
			aleph[sx][0] = aleph[sx][0]+1
			aleph[sx][1] = aleph[sx][1]+1
		else:
			aleph[sx]=[1,1]


ee = {}			
for x in aleph.keys():
	if aleph[x][1]==1:
		continue
	else:
		ee[x]=aleph[x]
print ee